package com.ciis.base.annotation;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

import java.util.Date;

@Aspect
public class GlobalLog {


    @Pointcut("execution(public * *(..))")
    public void point(){
        System.out.println("......");
    }

    @Around("execution(* com.ciis..*.*ServiceImpl.save*(..))")
    public void doAfter(ProceedingJoinPoint joinPoint) throws Throwable{
        String targetName = joinPoint.getTarget().getClass().getName();
        String methodName = joinPoint.getSignature().getName();
        joinPoint.getArgs();
        System.out.println(targetName+","+methodName);
        System.out.println(new Date());
        joinPoint.proceed();
    }
}
